/*
 * @Author: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @Date: 2025-03-21 21:11:44
 * @LastEditors: error: error: git config user.name & please set dead value or install git && error: git config user.email & please set dead value or install git & please set dead value or install git
 * @LastEditTime: 2025-03-22 22:14:57
 * @FilePath: /lesson/Thread_pool/Main.cc
 * @Description: 这是默认设置,请设置`customMade`, 打开koroFileHeader查看配置 进行设置: https://github.com/OBKoro1/koro1FileHeader/wiki/%E9%85%8D%E7%BD%AE
 */
#include"Threadpool.hpp"
#include"Task.hpp"
int main()
{
    Threadpool<Task>* tp=new Threadpool<Task>(5);
    tp->Init();
    tp->Start();

    int cnt=10;
    while(cnt)
    {
        // 向线程池不断地推送任务！
        sleep(1);
        Task t(1,1);
        tp->Equeue(t);
        sleep(1);
        cout<<"cnt: "<<cnt--<<endl;

    }

    tp->Stop();
    cout<<" thread pool is stop"<<endl;
    sleep(5);
    return 0;
}